#include "DisholDeviceManager.h"
#include "DisholDevice.h"

#include <stdio.h>
#include <assert.h>

#include <windows.h>

int main()
{
	Dishol::DeviceManager* deviceManager = new Dishol::DeviceManager();
	deviceManager->update();
	
	if ( deviceManager->getDevices().empty() )
		return 0;

	Dishol::Device* device = deviceManager->getDevices()[0];
	int i=0;
	while (i<50)
	{
		deviceManager->update();

		if ( i==5 || i==30)
		{
			bool ret = device->startCapture( 0 );
			printf("start:%d", ret);
		}
		
		::Sleep(100);
		
		printf(".");
		if ( i==20 || i==40 )
		{
			device->stopCapture();
			printf("stop" );
		}
		i++;
	}
	delete deviceManager;
	deviceManager = NULL;

	return 0;
}